{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "59407eaf",
   "metadata": {},
   "source": [
    "# ExpressionFactor\n",
    "\n",
    "## Overview\n",
    "\n",
    "The `ExpressionFactor` class in GTSAM is a template class designed to work with factor graphs in the context of nonlinear optimization. It represents a factor that can be constructed from a [GTSAM expression](../../../doc/expressions.md), allowing for flexible and efficient computation of error terms in optimization problems.\n",
    "\n",
    "The `ExpressionFactor` class allows users to define factors based on expressions in C++, that use (reverse) automatic differentiation to compute their Jacobians.\n",
    "\n",
    "## Main Methods\n",
    "\n",
    "### Constructor\n",
    "\n",
    "The `ExpressionFactor` class provides a constructor that allows for the initialization of the factor with a specific expression and measurement:\n",
    "\n",
    "```cpp\n",
    "  /**\n",
    "   * Constructor: creates a factor from a measurement and measurement function\n",
    "   *   @param noiseModel the noise model associated with a measurement\n",
    "   *   @param measurement actual value of the measurement, of type T\n",
    "   *   @param expression predicts the measurement from Values\n",
    "   * The keys associated with the factor, returned by keys(), are sorted.\n",
    "   */\n",
    "  ExpressionFactor(const SharedNoiseModel& noiseModel,  //\n",
    "                   const T& measurement, const Expression<T>& expression)\n",
    "      : NoiseModelFactor(noiseModel), measured_(measurement) {\n",
    "    initialize(expression);\n",
    "  }\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
